package com.yt.fras.utils;


import com.yt.fras.constant.ResultCode;
import com.yt.fras.pojo.base.JsonResult;

/**
 * ClassName:ResultTool
 * Package:com.yt.fras.utils
 * Description:
 *
 * @date:2021/8/15 17:15
 * @author:yt
 */

public class ResultTool {

    public static JsonResult success() {
        return new JsonResult(true);
    }

    public static <T> JsonResult<T> success(T data) {
        return new JsonResult(true, data);
    }

    public static JsonResult fail() {
        return new JsonResult(false);
    }

    public static JsonResult fail(ResultCode resultEnum) {
        return new JsonResult(false, resultEnum);
    }

}